
:ruby
  page_name ||= ''

.p-2
  .container-fluid
    .d-flex.flex-wrap.align-items-center.justify-content-between.w-100
      = link_to(next_prev_path(number: bs_request.number, request_action_id: prev_action&.id,
                                           diff_to_superseded: diff_to_superseded_id, page_name: page_name),
                class: "btn btn-outline-secondary #{prev_action ? '' : 'disabled'}",
                id: 'previous-action-button') do
        %i.fas.fa-angles-left
        Previous
      .dropdown.dropdown-center#request-actions
        %button.btn.dropdown-toggle{ 'aria-expanded' => 'false', 'data-bs-toggle' => 'dropdown',
                                                                          :type => 'button', 'data-boundary' => 'viewport' }
          = action.short_name
          - action_index = actions.find_index(action) + 1
          (##{action_index} of #{actions.count})
        %ul.dropdown-menu.scrollable-dropdown.pt-0
          %li.card-header.px-1.sticky-top.bg-body-tertiary
            %h6.dropdown-header
              - if User.session
                %span Seen
              %span Action
              %span.float-end Revision
          - actions_seen_by_user = BsRequestActionsSeenByUser.where(user: User.session, bs_request_action: actions).pluck(:bs_request_action_id)
          - actions.each_with_index do |action_item, action_index|
            %li.border-top
              = link_to((render partial: 'action_text', locals: { action: action_item, action_index: action_index,
                                                                  seen_by_user: actions_seen_by_user.include?(action_item.id) }),
                                                        next_prev_path(number: bs_request.number,
                                                                       request_action_id: action_item.id,
                                                                       diff_to_superseded: diff_to_superseded_id, page_name: page_name),
                                                        class: "dropdown-item #{action_item.id == action.id ? 'active' : ''}",
                                                        'aria-current': 'true')
      = link_to(next_prev_path(number: bs_request.number, request_action_id: next_action&.id,
                                       diff_to_superseded: diff_to_superseded_id, page_name: page_name),
                class: "btn btn-outline-secondary #{next_action ? '' : 'disabled'}",
                id: 'next-action-button') do
        Next
        %i.fas.fa-angles-right
.card-body
  %h5.mt-4
    Action details
    - if User.session
      %span#action-seen-by-user-wrapper
        = render ActionSeenByUserComponent.new(action: action, user: User.session)



  %p.fst-italic
    = render BsRequestActionDescriptionComponent.new(action: action)
